package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_ProxyAreaAddress 代理区域地址
 *
 */
public class TestData_TB_ProxyAreaAddress
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_ProxyAreaAddress saveMust(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.id.ID_ProxyAreaAddress id
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_ProxyAreaAddress");
		return (TB_ProxyAreaAddress)repository.save(newMust(
				id
			));
	}
	
	public static TB_ProxyAreaAddress newMust(
		bairui.international.model.domain.jpa.id.ID_ProxyAreaAddress id
	){
		return new TB_ProxyAreaAddress(new TB_ProxyAreaAddress.MustProperties() {
			@Override public bairui.international.model.domain.jpa.id.ID_ProxyAreaAddress getId(){
				return id;
			}
			/** 电话 */
			@Override public String getPhone(){
				return Generator.generate(0, 255);
			}
			/** 固定地址 */
			@Override public String getFixAddress(){
				return Generator.generate(0, 255);
			}
			/** 用户姓名 */
			@Override public String getUsername(){
				return Generator.generate(0, 30);
			}
			/** 地址 */
			@Override public String getAddress(){
				return Generator.generate(0, 255);
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_ProxyAreaAddress saveAll(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.id.ID_ProxyAreaAddress id
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_ProxyAreaAddress");
		return (TB_ProxyAreaAddress)repository.save(newAll(
				id
			));
	}
	
	public static TB_ProxyAreaAddress newAll(
		bairui.international.model.domain.jpa.id.ID_ProxyAreaAddress id
	){
		return new TB_ProxyAreaAddress(
			new TB_ProxyAreaAddress.MustProperties() {
				@Override public bairui.international.model.domain.jpa.id.ID_ProxyAreaAddress getId(){
					return id;
				}
				/** 电话 */
				@Override public String getPhone(){
					return Generator.generate(0, 255);
				}
				/** 固定地址 */
				@Override public String getFixAddress(){
					return Generator.generate(0, 255);
				}
				/** 用户姓名 */
				@Override public String getUsername(){
					return Generator.generate(0, 30);
				}
				/** 地址 */
				@Override public String getAddress(){
					return Generator.generate(0, 255);
				}
			},
			new TB_ProxyAreaAddress.OptionalSingleProperties() {
			}
		);
	}
	

}
